package com.example.config;

import cn.dev33.satoken.stp.StpInterface;
import cn.dev33.satoken.stp.StpUtil;
import com.example.mapper.AuthMapper;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;

import java.util.List;

/**
 * satoken 权限配置、
 */
@Configuration
public class StpInterfaceImpl implements StpInterface {

    @Resource
    private AuthMapper authMapper;

    @Override
    public List<String> getPermissionList(Object loginId, String loginType) {
        return authMapper.getPermissionList(StpUtil.getLoginIdAsLong());
    }

    @Override
    public List<String> getRoleList(Object loginId, String loginType) {
        return authMapper.getRoleList(StpUtil.getLoginIdAsLong());
    }
}
